<div class="form">
    <?php
    Util::tsRegisterAssetJs('_form.js');
    /** @var TblUsuarioController $this */
    /** @var TblUsuario $model */
    /** @var AweActiveForm $form */
    $form = $this->beginWidget('ext.AweCrud.components.AweActiveForm', array(
        'type' => 'horizontal',
        'id' => 'tbl-usuario-form',
        'enableAjaxValidation' => true,
        'clientOptions' => array('validateOnSubmit' => false, 'validateOnChange' => true,),
        'enableClientValidation' => false,
    ));
    ?>

    <?php echo $form->errorSummary($model) ?>
    <?php echo CHtml::hiddenField('usuario_id', $model->isNewRecord ? '0' : $model->id_usu) ?>
    <div id="myModal" class="modal hide fade" style="display: none;" aria-hidden="true"> 
        <div class="modal-header">
            <a class="close" data-dismiss="modal">&times;</a>
            <h4></h4>
        </div>
        <div class="modal-body" id="modaBody">
            <!-- espacio para buscqueda de actor -->
        </div>
        <div class="modal-footer">
            <?php echo CHtml::button('Agregar', array('class' => 'btn btn-primary', 'id' => 'saveModal', 'data-dismiss' => "modal")); ?>
            <button class="btn" data-dismiss="modal" aria-hidden="true">Cerrar</button>
        </div>
    </div>
    <?php
//    $this->widget(
//            'bootstrap.widgets.TbButton', array(
//        'label' => 'Click me',
//        'type' => 'primary',
//        'htmlOptions' => array(
//            'data-toggle' => 'modal',
//            'data-target' => '#myModal',
//        ),
//            )
//    );
    ?>
    <div class="span12 ">

        <?php echo $form->textFieldRow($model, 'id_usu') ?>

<?php echo $form->dropDownListRow($model, 'id_tpusu', array('' => ' -- Seleccione -- ') + CHtml::listData(TblTpusuario::model()->findAll(), 'id_tpusu', TblTpusuario::representingColumn())) ?>
        <!--            </div>
                            
                                    <div class="span12 ">-->
        <?php echo $form->textFieldRow($model, 'ced_usu', array('maxlength' => 12)) ?>

<?php echo $form->textFieldRow($model, 'nom_usu', array('maxlength' => 100)) ?>
        <!--            </div>
                            
                                    <div class="span12 ">-->
        <?php echo $form->textFieldRow($model, 'ape1_usu', array('maxlength' => 60)) ?>

<?php echo $form->textFieldRow($model, 'ape2_usu', array('maxlength' => 60)) ?>
        <!--            </div>
                            
                                    <div class="span12 ">-->
        <?php echo $form->datepickerRow($model, 'fcna_usu', array('prepend' => '<i class="icon-calendar"></i>', 'options' => array('format' => 'yyyy-mm-dd'))) ?>

<?php echo $form->textFieldRow($model, 'gen_usu', array('maxlength' => 1)) ?>
        <!--            </div>
                            
                                    <div class="span12 ">-->
        <?php echo $form->textAreaRow($model, 'emai_usu', array('rows' => 3, 'cols' => 50)) ?>

<?php echo $form->textFieldRow($model, 'estcv_usu', array('maxlength' => 1)) ?>
        <!--            </div>
                            
                                    <div class="span12 ">-->
        <?php echo $form->textFieldRow($model, 'login_usu', array('maxlength' => 20)) ?>

<?php echo $form->textFieldRow($model, 'pass_usu', array('maxlength' => 15)) ?>
        <!--            </div>
                            
                                    <div class="span12 ">-->
<?php echo $form->textFieldRow($model, 'est_usu', array('maxlength' => 1)) ?>
    </div>   
    <div class="span12">
<?php // echo CHtml::button('telf'.CHtml::image(Yii::app()->baseUrl . "/images/add-phone.png"));
echo CHtml::link(CHtml::image(Yii::app()->baseUrl . "/images/nuevo.png") . '  Direccion','#direccion',array('id'=>'direccion'));
        echo CHtml::link(CHtml::image(Yii::app()->baseUrl . "/images/nuevo.png") . '  Telefono','#telefono',array('id'=>'telefono'))?>
    </div>
    <div class="span11">

        <?php
        $this->widget('bootstrap.widgets.TbTabs', array(
            'type' => 'tabs', // 'tabs' or 'pills'
            'htmlOptions' => array('id' => 'tabs'),
            'tabs' => array(
                array(
                    'label' => 'Direccion(es)',
                    'id' => 'tbl_direccion',
                    'itemOptions' => array('style' => 'display:block', 'id' => 'tbdireccion', 'class' => ''),
                    'content' => $this->renderPartial('_direccion', array('model' => TblDireccion::model()), TRUE, FALSE)
                ),
                array(
                    'label' => 'Telefono(s)',
                    'id' => 'tbl_telefono',
                    'itemOptions' => array('style' => 'display:block', 'id' => 'tbtelefono', 'class' => ''),
                    'content' => $this->renderPartial('_telefono', array('model' => TblTelefono::model()), TRUE, FALSE)
                ),
            ),
        ));
        ?>
    </div>
    <div class="form-actions">
        <?php
        $this->widget('bootstrap.widgets.TbButton', array(
            'buttonType' => 'submit',
            'type' => 'primary',
            'label' => $model->isNewRecord ? Yii::t('AweCrud.app', 'Create') : Yii::t('AweCrud.app', 'Save'),
        ));
        ?>
        <?php
        $this->widget('bootstrap.widgets.TbButton', array(
            //'buttonType'=>'submit',
            'label' => Yii::t('AweCrud.app', 'Cancel'),
            'htmlOptions' => array('onclick' => 'javascript:history.go(-1)')
        ));
        ?>
    </div>

<?php $this->endWidget(); ?>
</div>